# coding:utf-8

# 上一个词的词性筛选
def pre_word(s):
    if s == 'n' or s == 'np' or s == 'ns' or s == 'ni' or s == 'nz':
        return True
    if s == 'v' or s == 'a' or s == 'i' or s == 'j' or s == 'x' or s == 'id' or s == 'g' or s == 'u':
        return True
    if s == 't' or s == 'm':
        return True
    return False


# 当前词的词性筛选
def curr_word(s):
    if s == 'n' or s == 'np' or s == 'ns' or s == 'ni' or s == 'nz':
        return True
    if s == 'a' or s == 'i' or s == 'j' or s == 'x' or s == 'id' or s == 'g' or s == 't':
        return True
    if s == 't' or s == 'm':
        return True
    return False


# 临时：名词短语
def temp_word(s):
    if s == 'np' or s == 'ns' or s == 'ni' or s == 'nz':
        return True
    if s == 'j' or s == 'x' or s == 't':
        return True
    return False


# 获取实体信息
def get_ner_info(s):
    if s == 1:
        return '人物'
    if s == 2:
        return '地点'
    if s == 3:
        return '机构'
    if s == 4:
        return '数字'
    if s == 5:
        return '时间'
    if s == 6:
        return '日期'
    if s == 7:
        return '货币'
    if s == 8:
        return '汽车品牌'
    if s == 9:
        return '汽车车系'
    if s == 10:
        return '汽车车型'
    if s == 16:
        return '其它实体'

    if s == 'np':
        return '人物'
    if s == 'ns':
        return '地点'
    if s == 'ni':
        return '机构'
    if s == 'nz':
        return '专业名词'
    if s == 'i' or s == 'id':
        return '习语'
    if s == 'j':
        return '简称'
    if s == 'x':
        return '其它'
    if s == 't':
        return '时间'

    return '非实体'


# 获取实体描述信息
def get_detail_ner_info(s):
    if s == 1:
        return '包括人名'
    if s == 2:
        return '包括地区'
    if s == 3:
        return '包括机构名'
    if s == 4:
        return '数字'
    if s == 5:
        return '时间'
    if s == 6:
        return '日期'
    if s == 7:
        return '货币'
    if s == 8:
        return '汽车品牌'
    if s == 9:
        return '汽车车系'
    if s == 10:
        return '汽车车型'

    if s == 'np':
        return '人名、职位名等'
    if s == 'ns':
        return '国家、地区、城市等'
    if s == 'ni':
        return '组织机构'
    if s == 'nz':
        return ' '
    if s == 'i' or s == 'id':
        return ' '
    if s == 'j':
        return ' '
    if s == 'x':
        return ' '
    if s == 't':
        return ' '

    return '非实体'